<?php
	$tableConfig = 'tbl_feedback';
	if (isset($_POST['btSend'])){
		$name      = trim($_POST['txtName']);
		$email  = trim($_POST['txtEmail']);
		$feedback   = trim($_POST['txtContent']);
		$title   = trim($_POST['txtTitle']);
		$content_id = trim($_POST['txtContenID']);
		
		$sql = "insert into ".$tableConfig." (title, feedback, name, email, content_id, date_added) values ('".$title."','".$feedback."','".$name."','".$email."','".$content_id."',now())";
		//echo $sql;
		mysql_query($sql);
		}
?>
<div class="module">
        	<div class="feedback">
        
        <div class="titlefb">Ý KIẾN PHẢN HỒI</div>
        <div class="pages">
          <form id="form1" name="form1" method="post" action="aboutus.php">
            <label for="select">Sắp xếp theo:</label>
            <select name="select" id="select">
              <option>Mới nhất</option>
              <option>Cũ nhất</option>
            </select>			
          </form>
        </div>
		<?php
			$sql2 = "select * from tbl_feedback where content_id='".$_GET['id']."'";
			//echo $sql2;
			$result = mysql_query($sql2);
		?>
        <div class="ctfeedback">
		<?php while ($row = mysql_fetch_assoc($result)) {?>
          <div class="athinklistbg">
       		  <div class="titlebn"><?=$row['title']?></div>
				<div class="time"><?=$row['name'].' - '.$row['email']?></div>
            	<?=$row['feedback']?>
       	  </div><!--endathinklistbg--> 
		<?php }?>
        </div><!--endctfeedback-->
        <div class="pages"> Trang 1/20
                   	<a href="#" title="Trang trướcc"><img src="Images/FirstPage.gif" width="12" height="12" border="0" align="baseline" /></a><a href="#">1</a><a href="#">2</a><a href="#">3</a><a href="#" title="Trang sau"><img src="Images/LastPage.gif" width="12" height="12" border="0" align="baseline" /></a></div><!--endpages-->
        </div><!--endfeedback-->       
        </div><!--endmodule-->
        
        <div class="module">
          <div class="titlesitebar">GỞI Ý KIẾN CỦA BẠN</div>
		  <?php
			$fr = $_GET['frame'];
			$id = $_GET['id'];
		  ?>
          <form id="faq" name="frmContact" action="./?frame=<?=$fr?>&id=<?=$id?>" method="post">
          	<input name="txtName" type="text" value="Họ và tên" class="full" />
            <input name="txtEmail" type="text" value="Email" class="full" />
            <input name="txtCode" type="text" value="Mã xác nhận" class="code" />
            <img src="Images/image.gif" width="54" height="26" align="absbottom" />
            <a href="#" class="refresh"><input name="Submit" type="submit" id="button" value="" /></a>
            <div id="clearone"></div>
            <input name="Off" type="radio" value="Off" class="rdtype" />
            <label for="radio">Off</label>
             <input name="radio" type="radio" id="radio" value="radio" checked="checked" class="rdtype" />
            <label for="radio">Telex</label>
            <input type="radio" name="radio" id="radio" value="radio" class="rdtype" />
            <label for="radio">VNI</label>
            <input type="radio" name="radio" id="radio" value="radio" class="rdtype" />
            <label for="radio">VIQR</label>
            <input name="txtTitle" type="text" value="Tiêu đề" class="full" />
            <textarea name="txtContent" cols="" rows="5" class="full">Nội dung</textarea>
			<input type="hidden" name="txtContenID" value="<?=$_GET['id']?>" />
            <div class="btright">
				<a href="" class="reset">
					<input name="" type="reset" value="Reset" />
				</a> 
				
					<input name="btSend" type="submit" value="Submit" onclick="return btnSend_onclick()"/>
				
			</div>
          </form>
        </div>
        <!--endmodule-->